package com.authine.cloudpivot.ext.Enum;

import java.util.Arrays;
import java.util.List;


public enum BillType {
    /**
     * 账单类型枚举
     */
    Goods("商品账单"),
    Balance("补差账单"),
    PlatformFee("平台费账单"),
    FinancialFee("金融费账单"),
    Refund("退款账单"),
    PlatformFeeRefund("平台费退款账单"),
    FinancialFeeRefund("金融费退款账单"),
    ;
    public String des;

    public BillType get() {
        return this;
    }

    BillType(String des) {
        this.des = des;
    }

    /**
     * 获取服务费枚举
     */
    public static List<BillType> getFee() {
        return Arrays.asList(PlatformFee, FinancialFee);
    }

    /**
     * 获取商品枚举
     */
    public static List<BillType> getGoods() {
        return Arrays.asList(Goods, Balance);
    }

    /**
     * 对应相反的枚举类型
     */
    public static BillType getReverse(BillType type) {
        switch (type) {
            case Goods:
                return Refund;
            case PlatformFee:
                return PlatformFeeRefund;
            case FinancialFee:
                return FinancialFeeRefund;
            case Refund:
                return Goods;
            case PlatformFeeRefund:
                return PlatformFee;
            case FinancialFeeRefund:
                return FinancialFee;
            default:
                return null;
        }
    }
}
